package Machine;

import java.util.*;

import experiments.singleLevelConverge;

public class Application {
	private String appName;
	private double responseTimeTarget;
	private boolean SLA=false;		// whether or not this application has an SLA
	private ArrayList<VirtualMachine> VMs=new ArrayList<VirtualMachine>();
	
	public Application(String appName){
		this.appName=appName;
		singleLevelConverge.addApp(this);
	}
	
	public Application(String appName,double responseTimeTarget){
		this.appName=appName;
		this.responseTimeTarget=responseTimeTarget;
		this.SLA=true;
		singleLevelConverge.addApp(this);
	}
	
	public void addVM(VirtualMachine VM){
		VMs.add(VM);
	}
	
	public double getRTTarget(){
		return this.responseTimeTarget;
	}
	
	public void setRTTarget(double target){
		this.responseTimeTarget=target;
	}
	
	public String getAppName(){
		return this.appName;
	}
	
	public boolean hasSLA(){
		return this.SLA;
	}
	
	public ArrayList<VirtualMachine> getVMs(){
		return this.VMs;
	}

}
